package com.tesis_2.BL;

import java.util.ArrayList;

import org.json.JSONException;
import org.w3c.dom.ls.LSSerializer;

import com.tesis_2.DA.DAOLocales;
import com.tesis_2.DA.DAORestaurants;
import com.tesis_2.MO.MOLocal;

public class BLLocales {

	private static ArrayList<MOLocal> lsLocal;

	public static ArrayList<MOLocal> getLsLocal() {
		return lsLocal;
	}

	public static void setLsLocal(ArrayList<MOLocal> lsLocal) {
		BLLocales.lsLocal = lsLocal;
	}
	
	public static void fillLocales() throws JSONException{
		BLLocales.lsLocal = DAOLocales.getLocales();
		
	}
	
	public static ArrayList<MOLocal>  getLocalsByRestId(Integer Restid) throws JSONException{
		
		ArrayList<MOLocal> lsLocalall = DAOLocales.getLocales();
		ArrayList<MOLocal> lsLocalByRestId = new ArrayList<MOLocal>();
		
		for (MOLocal l: lsLocalall)
		{
			if (l.getRest_id()==Restid) lsLocalByRestId.add(l);
		}
		
		return lsLocalByRestId;
	}
	


	
}
